class MirrorError(Exception):
    """所有镜像相关异常的基类"""
    pass

class MirrorNotFoundError(MirrorError):
    """镜像源不存在异常"""
    def __init__(self, mirror_name: str):
        super().__init__(f"镜像源 '{mirror_name}' 不存在")
        self.mirror_name = mirror_name

class SignatureVerificationError(MirrorError):
    """签名验证失败异常"""
    def __init__(self, url: str):
        super().__init__(f"镜像 '{url}' 的 GPG 签名验证失败")
        self.url = url

class SandboxSecurityError(MirrorError):
    """沙盒安全策略违规异常"""
    def __init__(self, syscall: str):
        super().__init__(f"沙盒禁止的系统调用: {syscall}")
        self.syscall = syscall

class DistroNotSupportedError(MirrorError):
    """发行版不支持异常"""
    def __init__(self, distro: str):
        super().__init__(f"不支持的发行版: {distro}")
        self.distro = distro

class MirrorToolError(Exception):
    """所有工具异常的基类"""
    code = 1000

class SecurityError(MirrorToolError):
    """安全验证失败"""
    code = 2001

class NetworkError(MirrorToolError):
    """网络通信错误"""
    code = 2002